package com.example.demo528.controller;

import com.example.demo528.domain.Ebook;
import com.example.demo528.domain.Pet;
import com.example.demo528.resp.CommonResp;
import com.example.demo528.service.PetService;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class PetController {
    @Resource
    private PetService petService;

    @RequestMapping("/pet/list")
    public CommonResp list(String name){
        CommonResp<List<Pet>> resp = new CommonResp<>();
        List<Pet> list=petService.list(name);
        resp.setContent(list);
        return resp;
    }
}
